var path = require('path');
var webpack = require('webpack');
var merge = require('webpack-merge');
var AddAssetHtmlPlugin = require('add-asset-html-webpack-plugin');

var work_path = process.cwd();

var config = require('./base');

config = merge(config, {
    devtool: '',
    plugins: [
        
        new AddAssetHtmlPlugin({
            filepath: path.join(process.cwd() + '/dll/dll.min.js'),
            includeSourcemap: false,
        }),

        new webpack.DllReferencePlugin({
            manifest: require('../manifest.json'), // 指定manifest.json
            name: 'dll',  // 当前Dll的所有内容都会存放在这个参数指定变量名的一个全局变量下，注意与DllPlugin的name参数保持一致
        }),

        new webpack.DefinePlugin({
            "process.env": { NODE_ENV: JSON.stringify('production') },
            '____WEBPACK_DEBUG': JSON.stringify(false)
        })

        // new webpack.optimize.UglifyJsPlugin({
        //     minimize: true,
        //     compress: { warnings: false, drop_console: true },
        //     output: { comments: false }
        // })
    ]
})

module.exports = config;